﻿<UserControl x:Class="ChemProV.UI.StreamTableControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:System="clr-namespace:System;assembly=mscorlib"
    mc:Ignorable="d"
    d:DesignHeight="100" d:DesignWidth="400">
    
    <UserControl.Resources>
        <Style x:Key="HeaderBorder" TargetType="Border">
            <Setter Property="BorderThickness" Value="0,1,1,1" />
            <Setter Property="Background">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                        <GradientStop Color="#FFE0E0E0" Offset="0" />
                        <GradientStop Color="#FFffFFff" Offset="0.5" />
                        <GradientStop Color="#FFE0E0E0" Offset="1.0" />
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="BorderBrush">
                <Setter.Value>
                    <SolidColorBrush Color="Black" />
                </Setter.Value>
            </Setter>
        </Style>
        
        <Style x:Key="TextBoxStyle" TargetType="TextBox">
            <Setter Property="BorderThickness" Value="0,1,1,1"/>
            <Setter Property="BorderBrush" Value="Gray" />
        </Style>
        
        <Style x:Key="ComboBoxStyle" TargetType="ComboBox">
            <Setter Property="Background" Value="White"/>
        </Style>
        
    </UserControl.Resources>
    
    <Border x:Name="LayoutRoot" BorderThickness="1.0" BorderBrush="Black">
        <Grid x:Name="MainGrid" Background="White">        
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
        
            <!-- Row 1 is the table header that spans across all columns -->
            <Border Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="5" BorderThickness="0.0"
                HorizontalAlignment="Stretch" BorderBrush="Black" MouseLeftButtonDown="HeaderBorder_MouseLeftButtonDown">
                <Border.Background>
                    <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                        <GradientStop Color="#FFE0E0E0" Offset="0" />
                        <GradientStop Color="#FFffFFff" Offset="0.5" />
                        <GradientStop Color="#FFE0E0E0" Offset="1.0" />
                    </LinearGradientBrush>
                </Border.Background>
                <TextBlock x:Name="HeaderTextBlock" HorizontalAlignment="Center">Stream #(?)</TextBlock>
            </Border>
            <Button Grid.Column="4" Grid.Row="0"
                HorizontalAlignment="Right" x:Name="MinimizeButton">_</Button>

            <!-- Row 2 is the column headers -->
            <Border Grid.Column="0" Grid.Row="1" Style="{StaticResource HeaderBorder}" />
            <Border Grid.Column="1" Grid.Row="1" Style="{StaticResource HeaderBorder}">
                <TextBlock>Compounds</TextBlock>
            </Border>
            <Border Grid.Column="2" Grid.Row="1" Style="{StaticResource HeaderBorder}">
                <TextBlock>Label</TextBlock>
            </Border>
            <Border Grid.Column="3" Grid.Row="1" Style="{StaticResource HeaderBorder}">
                <TextBlock>Qty</TextBlock>
            </Border>
            <Border Grid.Column="4" Grid.Row="1" Style="{StaticResource HeaderBorder}">
                <TextBlock>Units</TextBlock>
            </Border>

            <Button Content="+" Grid.Row="2" Grid.Column="0" />
        </Grid>
    </Border>
</UserControl>
